package com.naiterui.ehp.bs.b2c.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.naiterui.ehp.bp.support.security.InterceptorAddition;
import com.naiterui.ehp.bs.b2c.common.interceptor.LogCostInterceptior;
import com.naiterui.ehp.bs.b2c.common.interceptor.LoginInterceptior;
import com.naiterui.ehp.bs.b2c.common.interceptor.UserInterceptior;

/**
 * @author guoyongxiang
 */
@Configuration
public class B2cInterceptorConfig {

    @Bean
    public InterceptorAddition b2cInterceptorAddition() {
        return InterceptorAddition.build(new UserInterceptior()).addPathPatterns("/b2c/**");
    }

    @Bean
    public InterceptorAddition b2cLogInterceptorAddition() {
        return InterceptorAddition.build(new LogCostInterceptior()).addPathPatterns("/b2c/**").excludePathPatterns("/");
    }

    @Bean
    public InterceptorAddition b2cLoginInterceptorAddition() {
        return InterceptorAddition.build(new LoginInterceptior()).addPathPatterns("/b2c/**");
    }
}
